<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>

  <!-- 引入axios文件 -->
  <script src="https://unpkg.com/axios/dist/axios.min.js"></script>

  <script>
    let article = {
      title: '看看你的',
      state: '草稿'
    }

    /* 发送请求 */
    axios({
      methods: 'post',
      url: '',
      data: article
    }).then((result) => {
      // console.log(result);
      console.log('成功的回调')
    }).catch(err => {
      console.log('失败的回调')
    });

    //别名的方式发送请求
    axios.get('').then(result => { }).catch(err => { })
    //post
    axios.post('', article).then(result => { }).catch(err => { }) // 后面的article是携带的参数
  </script>
</body>

</html>